package com.pms.service;


import com.pms.dao.MindDao;
import com.pms.entity.Mind;
import com.pms.util.DateUtil;
import com.pms.util.PKUtil;
import com.pms.util.Page;

public class MindService {
	Mind mind=new Mind();
	MindDao dao=new MindDao();
	public void save(String desc,String userId,String projectId){
		mind.setMindId(PKUtil.getPkId());
		mind.setDesc(desc);
		mind.setCreateTime(DateUtil.getNow());
		mind.setUserId(userId);
		mind.setProjectId(projectId);
		dao.save(mind);
		
	}
	
	public Page<Mind> findAll(String projectId,int pageNum){
		Page<Mind> page=new Page<Mind>(5,dao.getCount(projectId),pageNum);
		return dao.findAll(projectId, page);
		
	}
}
